package com.alibaba.citrus.ots.price.ability.functions.factory.price;

import com.alibaba.citrus.ots.price.ability.functions.entity.price.PriceTypeEntity;
import com.alibaba.lattice2.epoch.sdk.model.Result;
import com.epoch.app.otspricecenter.sdo.PriceTypeSDO;

/**
 * @author: qiaojiange
 * @create: 2021/09/16
 * @Description 价格类型工厂
 */
public class PriceTypeFactory extends PriceBaseFactory{


    public static PriceTypeEntity create(String priceTypeId) {
        Result<PriceTypeSDO> priceTypeSDOResult = queryRepository.queryPriceType(priceTypeId);
        PriceTypeEntity entity = null;
        if (priceTypeSDOResult.isSuccess()) {
            entity = PriceTypeEntity.of(priceTypeSDOResult.getResult());
        }
        return entity;
    }
}
